//
//  SOCalendar.h
//  Calendar
//
//  Created by 王文娟 on 16/7/13.
//  Copyright © 2016年 EJU. All rights reserved.
//

#import <UIKit/UIKit.h>

@class SOCalendar;

@protocol SOCalendarDelegate <NSObject>

@optional

/**
 *  当前日历滑动到哪一年了
 *
 *  @param calendar    self
 *  @param visibleYear 年份
 */
-(void)calendar:(SOCalendar *)calendar didShowYear:(NSInteger)visibleYear;
/**
 *  选中某一个日期
 *
 *  @param calendar self
 *  @param date     选中的日期
 */
-(void)calendar:(SOCalendar *)calendar didSelectDate:(NSDate *)date;

@end

typedef void(^SOCalendarVisibleYear)(NSInteger visibleYear);

typedef NS_ENUM(NSInteger, SOCalendarShowType){
    SOCalendarShowTypeMiddle = 0,
    SOCalendarShowTypeBefore,
    SOCalendarShowTypeAfter
};

@interface SOCalendar : UIView

/**
 *  显示的月数
 */
@property (nonatomic, assign) NSInteger monthNum;

@property (nonatomic, assign) SOCalendarShowType calendarShowType;

@property (nonatomic, strong) UIColor *weekendColor;

@property (nonatomic, strong) UIColor *weekdayColor;

@property (nonatomic, strong) UIColor *selectedColor;

@property (nonatomic, strong) UIColor *selectedBackgroundColor;

@property (nonatomic, strong) UIColor *todayColor;

/**
 *  月数的颜色，也就是header的颜色
 */

@property (nonatomic, strong) UIColor *monthColor;
/**
 *  是否隐藏分割线，默认显示（即值为NO）
 */
@property (nonatomic, assign) BOOL hideSeparatorLine;

@property (nonatomic, strong) UIColor *separatorLineColor;

/**
 *  当前日历滑动到哪一年 de Block
 */
@property (nonatomic, copy) SOCalendarVisibleYear visibleYear;

@property (nonatomic, weak) id<SOCalendarDelegate> delegate;

/**
 *  选中的日期，用于初始化赋值
 */
@property (nonatomic, strong) NSDate *selectedDate;

/**
 *   需要展示的日期,默认今天
 */
@property (nonatomic, strong) NSDate *showDate;


-(void)reloadData;

-(void)scrollToDate:(NSDate *)date;

@end
